#include "pathfollowwidget.h"
#include "topicfiled.h"
#include "node/rosnode.h"
#include <visualization_msgs/Marker.h>

PathFollowWidget::PathFollowWidget(QWidget *parent) : QWidget(parent)
{

    setupUI();
}


void PathFollowWidget::setupUI()
{
    QVBoxLayout *vl =new QVBoxLayout(this);
    vl->setContentsMargins(0,0,0,0);

    m_rviz = new QRviz(this);
    m_rviz->Display_Grid(true, "<Fixed Frame>",QColor(160,160,164));
    m_rviz->Display_Axes(true,"<Fixed Frame>","2","0.3");

    m_rviz->Display_Marker(QString::fromStdString(TopicFiled::uwbBaseFiled),QColor(255,0,0));

    QHBoxLayout *hB = new QHBoxLayout(this);
    m_btnOpenLader = new QPushButton(this);
    m_btnOpenLader->setText("打开");

    m_btnRecord = new QPushButton(this);
    m_btnRecord->setText("记录");

    m_btnOpenRogBag = new QPushButton(this);
    m_btnOpenRogBag->setText("查看");

    hB->addStretch();
    hB->addWidget(m_btnOpenLader);
    hB->addWidget(m_btnRecord);
    hB->addWidget(m_btnOpenRogBag);
    hB->addStretch();

    vl->addWidget(m_rviz);
    vl->addLayout(hB);

}
